package au.com.cgu.RescueUTest;

import static org.junit.Assert.*;

import java.util.Date;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import au.com.cgu.RescueU.Claim;
import au.com.cgu.RescueU.ClaimController;
import au.com.cgu.RescueU.Location;
import au.com.cgu.RescueU.Photo;
import au.com.cgu.RescueU.ThirdParty;
import au.com.cgu.RescueU.Vehicle;

public class TestClaim {

	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
	}

	@AfterClass
	public static void tearDownAfterClass() throws Exception {
	}

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void test() {
		Claim clm = new Claim("Michael Gu", "P1234");
		clm.setDescription("Driving around corner and crashed");
		clm.setIncidentTime(new Date());
		clm.setInsuredAtFault(true);
		Location loc = new Location("601 Bourke St",null,"Melbourne","3000","VIC","AU");
		loc.setLatitude(-37.81); 
		loc.setLongitude(144.96);
		clm.setLossLocation(loc);
		clm.setThirdParty(new ThirdParty("Some Guy", "0408532034", "timothy.armstrong@cgu.com.au", "123456ABC"));
		clm.setVehicle(new Vehicle("Suburu WRX STI","ABC123", "P1234"));
		Photo ph1 = new Photo("WRX Concept","Subaru-WRX-concept-02.jpg", null);
		clm.addPhoto(ph1);

		ClaimController tst = new ClaimController();
		clm = tst.lodge(clm);
		assertTrue("was null", clm.getClaimNumber() != null);
	}
}
